package org.imaginedays.androidall.ui;

import org.imaginedays.androidall.R;
import org.imaginedays.androidall.viewpageindicator.IconPagerAdapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class DownloadManagerAdapter extends FragmentPagerAdapter implements
		IconPagerAdapter {

	protected static final String[] CONTENT = new String[] { "已下载", "正在下载",
			"最近使用", };
	
	 protected static final int[] ICONS = new int[] {
         R.drawable.perm_group_calendar,
         R.drawable.perm_group_camera,
         R.drawable.perm_group_device_alarms,
 };

	private int mCount = CONTENT.length;

	public DownloadManagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int position) {
		return DownloadItemFragment.newInstance(CONTENT[position
				% CONTENT.length]);
	}
	
	@Override
	public CharSequence getPageTitle(int position) {
		return DownloadManagerAdapter.CONTENT[position
						% CONTENT.length];
	}

	@Override
	public int getCount() {
		return mCount;
	}

	@Override
	public int getIconResId(int index) {
		 return ICONS[index];
	}
	
	

}
